// 
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2005 - 2014 Media Design School
//
// File Name	: CannonComponent.h
// Desrciption	: CCannonComponent declaration file.
// Author		: Hayden Asplet.
// Mail			: hayden.asplet@mediadesignschool.com
//

#pragma once

#ifndef __CANNONCOMPONENT_H__
#define __CANNONCOMPONENT_H__

// Library Includes

// Local Includes
#include "SpaceInvadersObjectFactory.h"

class CCannonComponent : public CObjectComponent {
	// Member Functions
public:
	CCannonComponent();
	virtual ~CCannonComponent();

	virtual bool VInitialize(TiXmlElement* _pXmlData);
	virtual void VPostInitialize();
	virtual void VUpdate(float _fDeltaTime);

	void FireBullet();

	// Accessors.
	void AddToScore(int _iAmount);
	void LoseLife();
	void AddToAmmo();

	void SetInvulnerability(bool _bIsInvulnerable);
	void SetAmmo(int _iAmmo);
	void SetScore(int _iScore);
	void SetLives(int _iLives);

	int GetScore() const;
	int GetLives() const;
	int GetAmmoAmount() const;
protected:
private:

	// Member Variables
public:
protected:
private:
	int m_iScore;	// The player's score.
	int m_iLives;	// The amount of remaining lives.
	int m_iAmmo;	// The amount of ammunition the player currently has.
	float m_fInitialBulletVelocity;	// The velocity of the bullet when it is fired.
	float m_fBulletAcceleration;	// The acceleration of the bullet.
	bool m_bIsInvulnerable;
};

TStrongObjectComponentPtr CreateCannonComponent();


#endif